home *** CD-ROM | disk | FTP | other *** search
/ Babylon 5 Entertainment Utility / Babylon 5 - Entertainment Utility.iso / winvideo / setup.mst < prev    next >
Text File  |  1995-11-12  |  12KB  |  305 lines

  1. '**************************************************************************
  2. '*                  VfW 1.1 Runtime Setup
  3. '**************************************************************************
  4. '$INCLUDE 'setupapi.inc'
  5. '$INCLUDE 'mscpydis.inc'    ''System
  6. '$INCLUDE 'msdetect.inc'    ''Detects Avalilable Disk Space
  7.  
  8. ''Dialog ID's
  9. CONST WELCOME       = 100
  10. CONST ASKQUIT       = 200
  11. CONST EXITFAILURE   = 400
  12. CONST EXITQUIT      = 600
  13. CONST EXITSUCCESS   = 700
  14. CONST APPHELP       = 900
  15. CONST CHECK         = 2500
  16. CONST SMALLWIN      = 2200
  17. CONST RESTART       = 2600
  18. CONST RESTARTII     = 2700
  19.  
  20. ''Bitmap ID
  21. CONST LOGO = 1
  22.  
  23. GLOBAL SizeReq&  '' Total Disk Size required for installation
  24.  
  25. ''File Types
  26. GLOBAL WinDir$
  27. GLOBAL WinSysDir$
  28. GLOBAL WinSys32Dir$
  29. GLOBAL WINDRIVE$    ''Windows Drive Letter.
  30. GLOBAL CHECKSTATES$
  31. GLOBAL MinorVer%
  32. GLOBAL OnNT$
  33.  
  34. DECLARE SUB Install
  35. DECLARE FUNCTION MakePath (szDir$, szFile$) AS STRING
  36. DECLARE FUNCTION OnWindowsNT LIB "INIUPD.DLL" AS INTEGER
  37. DECLARE FUNCTION VflatdPresent LIB "iniupd.DLL" AS INTEGER
  38. DECLARE SUB Reboot LIB "iniupd.dll"
  39. DECLARE FUNCTION ExitWindowsExec  LIB "User" (Exec$, Param$) AS INTEGER
  40. declare function pmDeleteGroup LIB "pgdde.dll" (Group$) as integer
  41. declare function pmShowGroup LIB "pgdde.dll" (Group$, Cmd%) as integer
  42. declare function pmDeleteItem LIB "pgdde.dll" (Group$) as integer
  43.  
  44.  
  45. INIT:
  46.  
  47.     CUIDLL$ = "mscuistf.dll"            ''Custom user interface dll
  48.     HELPPROC$ = "FHelpDlgProc"          ''Help dialog procedure
  49.  
  50.     WIN32ENABLED% = 0
  51.     MajorVer% = GetWindowsMajorVersion()
  52.     MinorVer% = GetWindowsMinorVersion()
  53.     Processor% = GetProcessorType()
  54.     WinDir$ = GetWindowsDir()
  55.     DEST$ = GetWindowsDir()
  56.     WinSysDir$ = GetWindowsSysDir()
  57.     WinSys32Dir$ = WinDir$ + "system32"
  58.  
  59.     IF MajorVer% < 3 OR (MajorVer% = 3 AND MinorVer% < 10) THEN
  60.         i% = DoMsgBox("Microsoft Windows version 3.10 or greater is required for this software.  Please upgrade your version of Windows.", "Installation Problem", MB_OK+MB_TASKMODAL+MB_ICONHAND)
  61.         END
  62.     END IF
  63.  
  64.     'Prevents installation on 286
  65.     IF Processor% < 3 THEN
  66.         i% = DoMsgBox("Video for Windows requires a 386 or greater processor or emulator.", "Installation Problem", MB_OK+MB_TASKMODAL+MB_ICONHAND)
  67.         END
  68.     END IF
  69.  
  70.     ' Use Wowexec to determine version of NT.  3.1 did not stamp wowexec and wow returns 3.1 as version
  71.     IF OnWindowsNT() THEN
  72.           OnNT$ = "TRUE"
  73.           WowVersion$ = GetVersionOfFile(WinSys32Dir$ + "\wowexec.exe")
  74.           IF WowVersion$ = "" THEN
  75.              i% = DoMsgBox("Video for Windows does not run on Windows NT 3.1.  Please upgrade your version of Windows.", "Installation Problem", MB_OK+MB_TASKMODAL+MB_ICONHAND)
  76.              END
  77.           END IF
  78.     END IF
  79.  
  80.     SetBitmap CUIDLL$, LOGO
  81.     SetTitle "Video for Windows 1.1 Runtime"
  82.  
  83.     szInf$ = GetSymbolValue("STF_SRCINFPATH")
  84.     IF szInf$ = "" THEN
  85.        szInf$ = GetSymbolValue("STF_CWDDIR") + "SETUP.INF"
  86.     END IF
  87.     ReadInfFile szInf$
  88.  
  89.     WINDRIVE$ = MID$(GetWindowsDir, 1, 1)
  90.  
  91. WELCOME:
  92.     sz$ = UIStartDlg(CUIDLL$, WELCOME, "FInfoDlgProc", APPHELP, HELPPROC$)
  93.     IF sz$ = "CONTINUE" THEN
  94.        UIPop 1
  95.      ELSE
  96.         GOSUB ASKQUIT
  97.         GOTO WELCOME
  98.     END IF
  99.  
  100. ''Prepare Copy list and check size
  101.  
  102.     ClearCopyList
  103.     SrcDir$ = GetSymbolValue("STF_SRCDIR")
  104.  
  105. '' Remove DCISVGA file
  106.     AddSectionFilesToCopyList "remove", SrcDir$, WinSysDir$
  107.  
  108. ''  Runtime files (on Windows disk)
  109. ''  Do not install OLE or MPlayer if on next release of NT or Windows
  110.  
  111.     IF ((NOT OnNT$ = "TRUE") AND MinorVer% < 50) THEN                   'These files not necessary on Windows NT
  112.         AddSectionFilesToCopyList "MPlayer", SrcDir$, WinDir$
  113.         AddSectionFilesToCopyList "OLE2", SrcDir$, WinSysDir$
  114.     END IF
  115.     AddSectionFilesToCopyList "VfW Runtime", SrcDir$, WinSysDir$
  116.     AddSectionFilesToCopyList "ACM Drivers", SrcDir$, WinSysDir$
  117.     AddSectionFilesToCopyList "AVICodecs", SrcDir$, WinSysDir$
  118.     IF OnNT$ = "TRUE" THEN
  119.         AddSectionFilesToCopyList "NT MSVideo", SrcDir$, WinSys32Dir$
  120.     ENDIF
  121. ''*************************************************************************************************************************
  122. ''*************************************************************************************************************************
  123. ''To add a DCI provider, please un-comment the AddSectionFilesToCopyList,
  124. ''and add a "DCI Provider" section with to the SETUP.INF file.
  125. ''
  126. ''      AddSectionFilesToCopyList "DCI Provider", SrcDir$, WinSysDir$
  127. ''*************************************************************************************************************************
  128. ''*************************************************************************************************************************
  129.  
  130. ''  Check windrive diskspace
  131.     SizeReq& = GetCopyListCost ("","", "")
  132.     IF SizeReq& <> 0 THEN
  133.         GOSUB SMALLWIN
  134.         END
  135.     END IF
  136.  
  137. Install
  138.  
  139. '' Restart Windows: if it has to updates ACM from DOS, it restarts Windows automatically
  140. '' else, it gives the user the choice
  141.     RESTRT% = RestartListEmpty ()
  142.     Exe$ = DEST$ + "\_msrstrt.exe"
  143.     Batch$ = DEST$ + "\_mssetup.bat"
  144.     empty$ = ""
  145. RESTART:
  146.     IF RESTRT% = 0 THEN
  147.        sz$ = UIStartDlg(CUIDLL$, RESTART, "FInfo0DlgProc", 0, "")
  148.        IF sz$ = "REACTIVATE" THEN
  149.           GOTO RESTART
  150.        ENDIF
  151.        I% = ExitExecRestart ()
  152.        RemoveFile Exe$, cmoForce
  153.        RemoveFile Batch$, cmoForce
  154.        END
  155.     ELSE
  156.        sz$ = UIStartDlg(CUIDLL$, RESTARTII, "FQuitDlgProc", 0, "")
  157.        IF sz$ = "CONTINUE" THEN
  158.           I% = ExitWindowsExec (Exe$, empty$)
  159.           IF I% = 0 THEN
  160.              GOTO RESTART
  161.           ELSE
  162.              END
  163.          ENDIF
  164.        ELSEIF sz$ = "EXIT" THEN
  165.           UIPopAll
  166.           END
  167.        ELSEIF sz$ = "REACTIVATE" THEN
  168.           GOTO RESTART
  169.        ELSE
  170.           UIPop 1
  171.        END IF
  172.     END IF
  173.  
  174.  
  175. QUIT:
  176.     ON ERROR GOTO ERRQUIT
  177.  
  178.     IF ERR = 0 THEN
  179.         dlg% = EXITSUCCESS
  180.     ELSEIF ERR = STFQUIT THEN
  181.         dlg% = EXITQUIT
  182.     ELSE
  183.         dlg% = EXITFAILURE
  184.     END IF
  185. QUITL1:
  186.     sz$ = UIStartDlg(CUIDLL$, dlg%, "FInfo0DlgProc", 0, "")
  187.     IF sz$ = "REACTIVATE" THEN
  188.         GOTO QUITL1
  189.     END IF
  190.     UIPop 1
  191.     END
  192.  
  193. ERRQUIT:
  194.     i% = DoMsgBox("An installation problem occured, call the product support service", "Setup Problem", MB_OK+MB_TASKMODAL+MB_ICONHAND)
  195.     END
  196.  
  197.  
  198. ASKQUIT:
  199.     sz$ = UIStartDlg(CUIDLL$, ASKQUIT, "FQuitDlgProc", 0, "")
  200.  
  201.     IF sz$ = "EXIT" THEN
  202.         UIPopAll
  203. ''        ERROR STFQUIT
  204.         END
  205.     ELSEIF sz$ = "REACTIVATE" THEN
  206.         GOTO ASKQUIT
  207.     ELSE
  208.         UIPop 1
  209.     END IF
  210.     RETURN
  211.  
  212. SMALLWIN:
  213.     sz$ = UIStartDlg(CUIDLL$, SMALLWIN, "FInfo0DlgProc", 0, "")
  214.     IF sz$ = "REACTIVATE" THEN
  215.         GOTO SMALLWIN
  216.     END IF
  217.     UIPop 1
  218.     RETURN
  219.  
  220. '**
  221. '** Purpose:
  222. '**     Performs all installation operations.
  223. '** Arguments:
  224. '**     none.
  225. '** Returns:
  226. '**     none.
  227. '*************************************************************************
  228. SUB Install STATIC
  229.  
  230.     SetRestartDir WinDir$
  231.     CopyFilesInCopyList
  232.  
  233. ''Updating WIN.INI and SYSTEM.INI
  234. ''Only update SYSTEM.INI  on NT or next version of Windows for other codecs
  235.  
  236. IF ((NOT OnNT$ = "TRUE") AND MinorVer% < 50) THEN
  237.     IF VflatdPresent() = 0 THEN
  238.        CreateSysIniKeyValue WinDir$ + "system.ini", "386Enh", "device", "dva.386", cmoOverwrite
  239.     END IF
  240. END IF
  241.     CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.CVID", "iccvid.drv", cmoOverwrite
  242.     CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.MSVC", "msvidc.drv", cmoOverwrite
  243.     CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.IV32", "ir32.dll", cmoOverwrite
  244.     CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.IV31", "IR32.dll", cmoOverwrite
  245.     CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.MRLE", "MSRLE.drv", cmoOverwrite
  246.     I% = DoesIniKeyExist ("system.ini", "Drivers", "VIDC.RT21")
  247.     IF I% = 0  THEN
  248.        CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.RT21", "ir21_r.dll", cmoOverwrite
  249.     END IF
  250.     CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.YVU9", "ir21_r.dll", cmoOverwrite
  251.     CreateIniKeyValue WinDir$ + "WIN.INI", "mci extensions", "avi", "AVIVideo", cmoOverwrite
  252.     CreateIniKeyValue WinDir$ + "system.ini", "mci", "AVIVideo", "mciavi.drv", cmoOverwrite
  253.     CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "WaveMapper", "msacm.drv", cmoOverwrite
  254.     CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "MSACM.msadpcm", "msadpcm.acm", cmoOverwrite
  255.     CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "MSACM.imaadpcm", "imaadpcm.acm", cmoOverwrite
  256.     CreateIniKeyValue WinDir$ + "control.ini", "drivers.desc", "msacm.drv", "Microsoft Sound Mapper V2.00", cmoOverwrite
  257.     CreateIniKeyValue WinDir$ + "control.ini", "drivers.desc", "msadpcm.acm", "Microsoft ADPCM Codec V2.00", cmoOverwrite
  258.     CreateIniKeyValue WinDir$ + "control.ini", "drivers.desc", "imaadpcm.acm", "Microsoft IMA ADPCM Codec V2.00", cmoOverwrite
  259.     success% = pmShowGroup ("SSI Moviebooks",5)
  260.     success% = pmDeleteItem ("Video For Windows Installer")
  261. ''*************************************************************************************************************************
  262. ''*************************************************************************************************************************
  263. ''To add a DCI provider, please un-comment the UDH line, and un-comment and replace the <provider> with your own file name
  264. ''
  265. ''  CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "DCI", "<provider>", cmoOverwrite
  266. ''  CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "vids.draw", "udh.dll", cmoOverwrite
  267. ''*************************************************************************************************************************
  268. ''*************************************************************************************************************************
  269.  
  270. ''Do not register components not installed with Video for Windows on NT or next version of Windows.
  271. IF ((NOT OnNT$ = "TRUE") AND MinorVer% < 50) THEN
  272.     Run ("regedit.exe /s " + MakePath(WinDir$, "mplayer.reg"))
  273.     Run ("regedit.exe /s " + MakePath(WinSysDir$, "OLE2.reg"))
  274.     Run ("regedit.exe /s " + MakePath(WinSysDir$, "cleanup.reg"))
  275.  
  276. '' Mplayer
  277.     CreateProgmanItem "Accessories", "Media Player", MakePath(WinDir$, "mplayer.exe"), "", cmoOverwrite
  278.  
  279. END IF  ''NT and next version of Windows installation stop here.
  280.  
  281.     Run ("profdisp.exe")
  282. END SUB
  283.  
  284. '**
  285. '** Purpose:
  286. '**     Appends a file name to the end of a directory path,
  287. '**     inserting a backslash character as needed.
  288. '** Arguments:
  289. '**     szDir$  - full directory path (with optional ending "\")
  290. '**     szFile$ - filename to append to directory
  291. '** Returns:
  292. '**     Resulting fully qualified path name.
  293. '*************************************************************************
  294. FUNCTION MakePath (szDir$, szFile$) STATIC AS STRING
  295.     IF szDir$ = "" THEN
  296.         MakePath = szFile$
  297.     ELSEIF szFile$ = "" THEN
  298.         MakePath = szDir$
  299.     ELSEIF MID$(szDir$, LEN(szDir$), 1) = "\" THEN
  300.         MakePath = szDir$ + szFile$
  301.     ELSE
  302.         MakePath = szDir$ + "\" + szFile$
  303.     END IF
  304. END FUNCTION
  305.